package cn.bs.allensocket.mythread;

/**
 * Created by Allen on 2014/11/5.
 * 线程的交互
 */
public class InteractiveThread {
    public static void main(String[] ages){
        InteractiveThreadB tb = new InteractiveThreadB();
        tb.start();
        synchronized (tb){
            try{
                System.out.println("等待tb计算完成！");
                tb.wait();
            }catch (InterruptedException e){
                e.printStackTrace();
            }
            System.out.println("tb计算结果是：" + tb.total);
        }
    }

}
